﻿<%@ Page ValidateRequest="false" Language="C#" AutoEventWireup="true" CodeBehind="QuestionBase.aspx.cs" Inherits="CSM.Views.Wenjuan.QuestionBase" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>无标题页</title>
<script src="../../Js/jquery-1.1.3.1.pack.js" type="text/javascript"></script> 
<script src="../../Js/jquery.autocomplete.min.js" type="text/javascript"></script> 
<link href="../../App_Themes/Default_1/jquery.autocomplete.css" type="text/css" rel="stylesheet"/> 
<script type="text/javascript" src="../../Js/thickbox.js"></script>
<link rel="stylesheet" href="../../App_Themes/Default_1/thickbox.css" type="text/css" media="screen" />
<script language="javascript" type="text/javascript">
    var TfileUploadNum = 1; //记录图片选择框个数
    var Tnum = 1; //ajax上传图片时索引
    function TDeleteFileUpload() {
        TfileUploadNum = parseInt($("#OptionNum").val());
        if (TfileUploadNum == 1) {

        } else {
            TfileUploadNum -= 1;
            $("#Txt_Option" + TfileUploadNum).parent().parent().remove();
            $("#OptionNum").val(TfileUploadNum.toString());
        }
    }
    function closewind() {

        TfileUploadNum = 1;
        Tnum = 1;
        $("#OptionNum").val(1);
        window.tb_remove();
    };
    function TAddFileUpload() {
        TfileUploadNum = parseInt($("#OptionNum").val());
        if (TfileUploadNum < 8) {
            var idnum = TfileUploadNum + 1;
            var str = "<tr><td class='tdClass'>选项" + idnum + ":</td>";
            str += "<td class='tdClass'><input name='Txt_Option" + TfileUploadNum + "' id='Txt_Option" + TfileUploadNum + "' type='text'/></td></tr>";
            $("#imgTable").append(str);
            TfileUploadNum += 1;
            $("#OptionNum").val(TfileUploadNum);
        }
        //$("#uploadImg"+idnum+"").hide();
    }
    function addrow() {
        $("#Txt_Option0").parent().parent().remove();
        var src = $("#stringa").val();
        $("#imgTable").append(src);
    }
    function ShowThickBox(b, a) {
        var div = a;
        var title = b;
        imgLoader = new Image(); // preload image
        imgLoader.src = tb_pathToImage;
        window.tb_show(title, "#TB_inline?height=300&width=400&inlineId=" + div, "");
    };
    </script>
</head>
<body class = "CommonPage_Body">
    <form id="form1" runat="server">
        <table >

            <tr>
                <td colspan="3" >
                <asp:Button ID="Button_Add" runat="server" OnCommand="Button_Add_Command" Text="增加" skinid="Button"/>
                </td>
                <td >
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <asp:Panel ID="Panel_Gridlist" runat="server">
                       <asp:Label ID="Label1" runat="server" SkinID="Label" Text="题目内容："></asp:Label>  <asp:TextBox ID="txtUser" runat="server" ></asp:TextBox>
                        <asp:Button ID="Button_Browse" runat="server" Text="查询" skinid="Button" 
                            onclick="Button_Browse_Click"/>
                        <br>
                        <br>
                        <asp:LinkButton ID="LinkButton_First" runat="server" CommandArgument="First" 
                            OnClick="MyClick" ><img src = "../../App_Themes/Default_1/Images/Page_First.gif" class = "Page_First"alt = "首页" /></asp:LinkButton>                
                        <asp:LinkButton ID="LinkButton_Prev" runat="server" CommandArgument="Prev" 
                            OnClick="MyClick"><img  src = "../../App_Themes/Default_1/Images/Page_Prev.gif" class = "Page_Prev"  alt = "上页"/></asp:LinkButton>               
                        <asp:LinkButton ID="LinkButton_Next" runat="server" CommandArgument="Next" 
                            OnClick="MyClick"><img  src = "../../App_Themes/Default_1/Images/Page_Next.gif"  class = "Page_Next"  alt = "下页"/></asp:LinkButton>                      
                        <asp:LinkButton ID="LinkButton_Last" runat="server" CommandArgument="Last" 
                            OnClick="MyClick"><img   src = "../../App_Themes/Default_1/Images/Page_Last.gif" class = "Page_Last" alt = "末页"/></asp:LinkButton>
                        <asp:Label ID="Label_Total" runat="server" SkinID="Label" Text="共："></asp:Label>
                        <asp:Label ID="Label_CurrenPageAndTo" runat="server" SkinID="Label" 
                            Text="页，当前第 页，转到"></asp:Label>
                        <asp:TextBox ID="TextBox_PageIndex" runat="server" Width="26px"></asp:TextBox>
                        <asp:Label ID="Label4" runat="server" SkinID="Label" Text="页"></asp:Label>
                        <asp:RangeValidator ID="RangeValidator_PageIndex" runat="server" 
                            ControlToValidate="TextBox_PageIndex" ErrorMessage="*" MaximumValue="10000" 
                            MinimumValue="1" Type="Integer"></asp:RangeValidator>
                        <asp:Button ID="Button_PageGo" runat="server" CommandArgument="GotoPage" 
                            OnClick="MyClick" skinid="Button" Text="GO" />
                        <asp:GridView ID="GridView_Users" runat="server" AutoGenerateColumns="False" 
                            SkinID="gridview">
                            <Columns>

                                <asp:BoundField DataField="QuestionID" HeaderText="题目ID" ReadOnly="True" 
                                    SortExpression="题目ID" />
                                <asp:BoundField DataField="Qtype" HeaderText="题目类型" ReadOnly="True" 
                                    SortExpression="题目类型" />
                                <asp:BoundField DataField="Title" HeaderText="题目内容" ReadOnly="True" 
                                    SortExpression="题目内容" />
                                <asp:TemplateField>
                                    <ItemTemplate>
                                    <asp:Button ID="Button_Edit" runat="server"  oncommand="Button_Edit_Command"
                                        CommandArgument='<%# Eval("QuestionID") %>'    skinid="Button" Text="编辑"/>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                    <asp:Button ID="Button_Delete" runat="server"  oncommand="Button_Delete_Command"
                                        CommandArgument='<%# Eval("QuestionID") %>' OnClientClick="return confirm('确定要删除该题目？');" skinid="Button" Text="删除"/>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                        <br></br>
                        </br>

                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td  colspan="4">
                    &nbsp;
                    <asp:Panel ID="Panel_Edit" runat="server" visible="false">
                        <table id="imgTable" style="width:100%;" runat="server">
                        <tr>
                                <td colspan="2">
                                   <%-- <asp:Button ID="Button_Save" runat="server"   skinid ="Button" oncommand="Button_Save_Command"
                                        Text="保存" OnClientClick="save_data();" UseSubmitBehavior="False" />--%>
                                         <asp:Button ID="Button_Save" runat="server"   skinid ="Button" oncommand="Button_Save_Command"
                                        Text="保存"  UseSubmitBehavior="False" />
                                    <asp:Button ID="Button_Cancel"  skinid ="Button" runat="server"
                                        Text="取消" oncommand="Button_Cancel_Command"  OnClientClick="closewind();"/>
                                        <asp:Button ID="CancelUpload"  skinid ="Button" runat="server" Text="减少" OnClientClick="TDeleteFileUpload();return false;"/>
                                        <asp:Button ID="AddUpload"  skinid ="Button" runat="server" Text="增加" 
                                        OnClientClick="TAddFileUpload();return false;"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label5" runat="server" Text="题目ID：" SkinID="Label"></asp:Label>
                                </td>
                                <td >
                                    <asp:TextBox ID="TextBox_QId" runat="server" SkinID="TextBox" ></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label6" runat="server" Text="题目内容：" SkinID="Label" ></asp:Label>
                                </td>
                                <td >
                                    <asp:TextBox ID="TextBox_Content" runat="server" SkinID="TextBox" TextMode="MultiLine" Height = "50px" Width = "200px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label10" runat="server" Text="简答题：" SkinID="Label"></asp:Label>
                                </td>
                                <td >
                                    <asp:CheckBox ID="CheckBox_QuesType" runat="server" SkinID="CheckBox" />
                                </td>
                            </tr>
                            <tr>
                            <td class="tdClass">选项1:</td>
                            <td><input name="Txt_Option0" id="Txt_Option0" type="text"/>
                            </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    <asp:HiddenField ID="EditFlag" runat="server" Value="0" />
                    <asp:HiddenField ID="OptionNum" runat="server" Value="1" />
                    <asp:HiddenField ID="stringa" runat="server" Value="" />
                </td>
                <td>
                    <asp:HiddenField ID="CurrentPage" runat="server" Value="0" />
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
          <div id = "MyThickBox"></div>
          <div id="divResult" style="border-right: #003399 1px solid; border-top: #003399 1px solid; border-left: #003399 1px solid; border-bottom: #003399 1px solid;width:100px;height:150px;position:absolute;display:none;background-color:#CCFFFF">
   
  </div> </form>
</body>
</html>
<% =alert %>